package com.app.base;

/**
 * 最基础的StringKeyValue
 * @author lijianhua
 */
public enum BaseError implements ErrorCode {

    /**
     * 操作成功
     */
    OK_KEY_VALUE("200","操作成功!"),


    /**
     * 授权类
     */
    AUTH_RSA_KEY_GEN_ERROR("9000","RSA秘钥生成失败"),
    AUTH_INTERFACE_ERROR("9001","权限系统接口异常："),
    AUTH_IINVALID_TOKEN("9002","无效的token"),
    AUTH_IINVALID_SIGN("9003","无效的签名"),
    AUTH_USER_PASSWORD_ERROR("9004","用户名密码错误"),
    AUTH_UNKNOWN_ACCOUNT("9005","未知账号"),
    AUTH_USER_ROLE_EMPTY("9006","用户未授权角色！"),

    /**
     * 第三方
     */
    THIRD_AUTH_SIGN_EMPTY("10001","接口签名sign为空！"),
    THIRD_API_INVOKE_ERROR("10002","第三方接口调用异常！"),
    THIRD_USER_UNAUTHORIZED("10003","第三方用户未授权！"),
    THIRD_API_ERROR("521","远程服务失败"),


    /**
     * 内部错误
     */

    BI_INNER_ERROR("500","内部服务错误!"),
    BI_NULLPOINTEREXCEPTION("501","空指针异常!"),
    BI_OBJECT_NOT_EXIST("503","对象不存在"),
    BI_UNIQUE_ERROR("504","唯一性验证失败"),
    BI_PARAMS_EMPTY("505","必要参数不能为空"),
    BI_MESSAGE_CONVERSION_EXCEPTION("506","参数类型转换错误"),
    BI_CLASSCASTEXCEPTION("506","对象强制转换失败"),
    BI_ILLEGALARGUMENTEXCEPTION("507","非法参数"),
    BI_NOSUCHMETHODEXCEPTION("508","无法找到方法"),
    BI_ARITHMETICEXCEPTION("509","数值运算异常"),
    BI_METHODARGUMENTNOTVALIDEXCEPTION("510","方法参数校验异常"),


    BI_FILE_UPLOAD_ERROR("510","文件上传失败!"),

    BI_DBEXCEPTION("520", "数据库操作异常"),
    BI_DELETE_DATA_NOT_EXISTS("521","删除的记录不存在！"),
    BI_ADD_DATA_ERROR("523","数据添加失败！"),
    BI_UPDATE_DATA_ERROR("524","数据修改失败！"),
    BI_DELETE_DATA_ERROR("525","数据删除失败！"),
    BI_QUERY_DATA_EMPTY("526","查询数据为空"),
    BI_SQLSYNTAXERROREXCEPTION("527","SQL执行异常"),

    BI_ERROR_KEY_VALUE("999","未知异常");

    /**
     * 编码
     */
    private String code;

    private String msg;


    BaseError(String code, String msg) {
        this.code = code;
        this.msg=msg;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {

        return this.msg;
    }
}
